package com.netstar.jsonparser;

public class ParserFactory {

	public static final int TYPE_ERROR = 800;

	public static AbstractParser createParser(int type, String data) {
		if (data == null) {
			throw new IllegalArgumentException("ParserFactory : data can not be null");
		}
		switch (type) {
			case TYPE_ERROR:
				return new ServerErrorParser(data);
			default:
				throw new IllegalArgumentException("ParserFactory: unknown parser type " + type);
		}
	}
}
